/****************************************************************************
**                                                                         **
**                        PSSDK HNPSManager module                         **
**            Copyright (c) 1997 - 2006 microOLAP Technologies LTD,        **
**                       Khalturin A.P., Naumov D.A.                       **
**                               Header File                               **
**                                                                         **
****************************************************************************/

//---------------------------------------------------------------------------
#ifndef __HN_PSSDK_MANAGER_H__
#define __HN_PSSDK_MANAGER_H__
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// Class CHNPSManager
//---------------------------------------------------------------------------
class CHNPSManager
{
private:
    HANDLE hMgr;

public:
    //###########################################################################
    //    Create & Destroy
    //###########################################################################

    //---------------------------------------------------------------------------
    // MgrCreate - Creates an HNPSManager object.
    CHNPSManager() { hMgr = MgrCreate(); }

    //---------------------------------------------------------------------------
    // MgrDestroy - Destroys an HNPSManager object.
    ~CHNPSManager() { MgrDestroy(hMgr); }

public:
    //###########################################################################
    //    Additionals methods
    //###########################################################################
    BOOL     IsValid() { return (hMgr != NULL); }
    HANDLE   Get_Handle() { return hMgr; }
    operator HANDLE() { return hMgr; }


public:
    //###########################################################################
    //    Methods of redirect
    //###########################################################################

    //---------------------------------------------------------------------------
    // MgrAbout - Displays information about Packet Sniffer SDK.
    void About() 
    { MgrAbout(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetVersion - Returns the version number of the Packet Sniffer SDK library.
    LPCSTR Get_Version() 
    { return MgrGetVersion(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetBuild - Returns the build number of the Packet Sniffer SDK library.
    LPCSTR Get_Build() 
    { return MgrGetBuild(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetWanMonitorState - Returns the WANMonitor installation status.
    BOOL Get_WanMonitorState() 
    { return MgrGetWanMonitorState(hMgr); }

    //---------------------------------------------------------------------------
    // MgrSetWanMonitorState - Sets the WANMonitor installation status.
    BOOL Set_WanMonitorState(BOOL bEnable) 
    { return MgrSetWanMonitorState(hMgr,bEnable); }

    //---------------------------------------------------------------------------
    // MgrInitialize - Initializes Packet Sniffer SDK.
    DWORD Initialize() 
    { return MgrInitialize(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetAdaptersCfgCount - Returns the number of the HNAdapterConfig objects.
    DWORD Get_AdaptersCfgCount() 
    { return MgrGetAdaptersCfgCount(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetFirstAdapterCfg - Returns the handle of the first HNAdapterConfig object.
    HANDLE Get_FirstAdapterCfg() 
    { return MgrGetFirstAdapterCfg(hMgr); }

    //---------------------------------------------------------------------------
    // MgrGetNextAdapterCfg - Returns the handle of the next HNAdapterConfig object.
    HANDLE Get_NextAdapterCfg(HANDLE hCfg) 
    { return MgrGetNextAdapterCfg(hMgr,hCfg); }

    //---------------------------------------------------------------------------
    // MgrRefreshAdapterList - Refreshes the internal list of the HNAdapterConfig objects.
    DWORD RefreshAdapterList() 
    { return MgrRefreshAdapterList(hMgr); }

    //---------------------------------------------------------------------------
    // MgrSetOnConfigChange - Sets the OnConfigChange event.
    FARPROC Set_OnConfigChange(FARPROC pfOnConfigChange, DWORD_PTR Param) 
    { return MgrSetOnConfigChange(hMgr,pfOnConfigChange,Param); }     
};

//---------------------------------------------------------------------------
#endif // __HN_PSSDK_MANAGER_H__
//---------------------------------------------------------------------------
